package com.hengpeng.itfin.service;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.hengpeng.common.exception.ServiceResult;
import com.hengpeng.itfinbase.message.ResponseMessage;
import com.hengpeng.itfinbase.message.partner.CorpOpenResponseMsg;
import com.hengpeng.itfinbase.message.partner.CorpRegisterQueryResponse;
import com.hengpeng.itfinbase.message.partner.OpenResponseMsg;
import com.hengpeng.itfinbase.message.userInfo.MobileBingRequest;
import com.hengpeng.itfinbase.message.userInfo.RealNameAuthRequest;
import com.hengpeng.itfinbase.message.userInfo.UserInfoRegisterRequest;
import com.hengpeng.itfinbase.message.userInfo.UserInfoResponse;
import com.hengpeng.itfinbase.message.userInfo.UserLoginRequest;
import com.hengpeng.itfinbase.message.userInfo.UserSetProtectPwdRequest;
import com.hengpeng.itfinbase.message.userInfo.UserUpdatePwdRequest;
import com.hengpeng.itfinbase.persist.UserBankCard;
import com.hengpeng.itfinbase.persist.UserInfo;

public interface UserInfoService
{
	/**
	 * <pre>
	 * 会员注册
	 * </pre>
	 * @param request
	 * @return
	 */
	public UserInfoResponse register(UserInfoRegisterRequest request);
	
	public UserInfo getUserByUserName(String userName);

	public UserInfo getUserByTrustAccountId(String trustAccountId);
	
	public UserInfo getUserByBusiCode(String busiCode);
	/**
	 * <pre>
	 * 会员登录
	 * </pre>
	 * @param request
	 * @return
	 */
	public UserInfoResponse login(UserLoginRequest request);
	/**
	 * <pre>
	 * 处理开户
	 * </pre>
	 * @param msg
	 * @return
	 */
	public ServiceResult<UserInfo> dealOpenResult(OpenResponseMsg msg);

	/**
	 * <pre>
	 * 处理企业开户
	 * </pre>
	 * @param msg
	 * @return
	 */
	public ServiceResult<UserInfo> dealCorpOpenResult(CorpOpenResponseMsg msg);
	
	/**
	 * <pre>
	 * 处理企业开户查询
	 * </pre>
	 * @param msg
	 * @return
	 */
	public ServiceResult<UserInfo> dealCorpRegisterQueryResult(CorpRegisterQueryResponse msg);
	
	/**
	 * 实名认证
	 * @param request
	 */
	public UserInfoResponse realNameAuth(RealNameAuthRequest request);
	
	/**
	 * 修改密码
	 */
	public UserInfoResponse updatePassword(UserUpdatePwdRequest request);
	
	/**
	 * 设置密保
	 */
	public UserInfoResponse doSetQuestionPwd(UserSetProtectPwdRequest request);
	
	/**
	 * <pre>
	 * 添加账户银行卡
	 * </pre>
	 * @param UserBankCard {userName:用户名, providerId:服务商, realName:真实姓名, accountNo:绑定账号, bankName:银行名称,
	 *        province:银行省份, city:银行城市, branch:分行名称, subbranch:支行名称 }
	 * @return 
	 */
	public ResponseMessage saveUserBankCard(UserBankCard bindAccount);

	/**
	 * <pre>
	 *  绑定银行卡
	 * </pre>
	 * @param UserBankCard
	 * @return
	 */
	public ResponseMessage userBindCard(UserBankCard bindAccount);
	
	/**
	 * <pre>
	 * 修改银行卡
	 * </pre>
	 * @param UserBankCard { providerId:服务商, accountNo:绑定账号, bankName:银行名称, province:银行省份, city:银行城市, branch:分行名称,
	 *        subbranch:支行名称 }
	 * @return 
	 */
	@Transactional(propagation = Propagation.REQUIRED)
	public ResponseMessage updateUserBindCard(UserBankCard bindAccount);
	
	/**
	 * <pre>
	 *  删除绑定资金账户
	 * </pre>
	 * @param betCardNo 投注卡号
	 * @param id 绑定资金账户ID
	 * @return 成功信息
	 */
	public ResponseMessage removeUserBindCard(Long id);
	
	/**
	 * <pre>
	 * 绑定手机号码
	 * </pre>
	 * @param request
	 * @return
	 */
	public ResponseMessage bingMobile(MobileBingRequest request);
}
